
package com.hulk.ratel.common.constant.enums;

import com.google.common.base.Objects;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 商户交易处理进程
 */
@Getter
@AllArgsConstructor
public enum TxnProcessStep {
	ACCEPTED("01","受理请求插入流水"),
	WAITING("02","向支付机构发送请求等待支付机构响应"),
	RECEIVED_SYNC("03","收到支付机构同步响应"),
	RECEIVED_ASYNC("04","收到支付机构回调响应"),
	COMPLETE_SYNC("05","返回前端商户同步交易完成"),
	COMPLETE_ASYNC("06","返回前端商户回调交易完成"),
	;

	private String value;

	private String desc;

	public static String explain(String value) {
		for (TxnProcessStep obj : TxnProcessStep.values()) {
			if (Objects.equal(value, obj.value)) {
				return obj.desc;
			}
		}
		return value;
	}

}
